package com.cnzhy.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhaoyan5
 */
@RestController
@RequestMapping("/aop")
@Slf4j
public class AopController {

    @RequestMapping("/test")
    public String testAop(String key) {
        return "testAop: key = " + key;
    }

    @RequestMapping("testAfterThrowing")
    public String testAfterThrowing(String key) {
        throw new NullPointerException(key);
    }

    @RequestMapping("/testAround")
    public String testAround(String key) {
        return "环绕通知：key = " + key;
    }

}
